Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
=========================================
Coverage 99.64% 99.64%
- Complexity 1969 1971 +2
=========================================
Files 145 145
Lines 4513 4515 +2
=========================================
+ Hits 4497 4499 +2
Misses 16 16 ☔ View full report in Codecov by Harness. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Parked; not ready to merge. The branch's current head ( Open question before resuming: the per-kind visibility checks in Options when this is picked back up:
🤖 Generated with Claude Code |
Closes #870.
VariableBindingsdecided what is bound at a position by where each statement starts. Each kind of binding actually takes effect at a different point, so each kind got its own check, added only after a crash exposed it (#869 for assignments). This replaces the per-kind checks with one rule: a variable is bound once the code PHP runs before assigning it has finished before the position. Each binding kind names that code:foreach, so inforeach ($x as $x)resolving the subject found the loop's own$x, which resolved the subject again, recursing until the server crashed (A foreach over a variable it rebinds must not crash the server #870). Hovering$users->getName()insideforeach ($users as $users)reproduced it as a segfault.trystatement, so inside thetrybody$ealready counted as bound.Parameters and
usevariables are unchanged: they are bound before the body runs.Each case has a unit test in
VariableBindingsTest. #869's existing assignment test passes unchanged. A catch without a variable now also has a test.There is no end-to-end case. With the crash gone, hover inside such a loop answers with nothing, because the element type of a loop over a variable is never resolved: element types are currently read only from the docblock of a call or property being iterated directly. That limitation predates this change and is out of scope.
Not covered: assignments nested inside expressions, such as
if ($user = find()), are still never bound. That is a missing binding kind rather than a timing problem.🤖 Generated with Claude Code